#include <cstdio>
#include <string>
#include "Book.h"

using namespace std;

int Book::counter = 0;

Book::Book(string _Title, string _author, Date _pub_date)
{
	Assign(_Title, _author, _pub_date);
	counter += 1;  // One more book.
}

Book::~Book()
{
	counter -= 1;  // One less book.
}

void Book::Assign(string _Title, string _author, Date _pub_date)
{
	Title = _Title;
	author = _author;
	pub_date = _pub_date;
}

void Book::show()
{
	printf("[%s], %s, %04d-%02d-%02d\n", Title.c_str(), author.c_str(), pub_date.year, pub_date.month, pub_date.day);
}

int Book::getTotal()
{
	return counter;
}
